package com.tyylab.message.core.config;

import com.tyylab.message.core.service.*;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ImportAutoConfiguration(classes = {RedisConfig.class})
@ComponentScan(basePackages = {"com.tyylab.message.core.config.properties"})
public class PublishConfig {

    @Bean
    @ConditionalOnMissingBean
    public IPublish defaultPublish(){
        return new PublishSevice();
    }

    @Bean
    @ConditionalOnMissingBean
    public ISyncPublish defaultSyncPublish(){
        return new SyncPublishSevice();
    }

    @Bean
    @ConditionalOnMissingBean
    public IChannelCheck defaultChannelCheck(){
        return new ChannelCheckService();
    }
}
